import {
    getAgreement
} from '../../api/api';
const app = getApp();

Page({

    data: {
        parameter: {
            'navbar': '1',
            'return': '1',
            'title': '协议详情',
        },
        type: 'user',
        articleInfo: {},
    },

    onLoad: function (options) {
        if (options) {
            this.setData({
                type: options.type,
                parameter: {
                    ...this.data.parameter,
                    title: options.type == 'user' ? '用户协议' : '隐私政策',
                }
            });
        }
        this.requestArticleContent();
    },

    requestArticleContent() {
        let _this = this;
        getAgreement().then((res) => {
            console.log(res.data.info);
            _this.setData({
                articleInfo: res.data.info,
            });
        })
        .catch((error) => console.log(error));
    }

})